{% extends "base.html" %}
{% block conteudo%}


<script>
	// socket.io specific code
	//var socket = io.connect('{{java_game_client_host}}');
	
	//socket.on('error', function(e) {
	// disableLogin();
	//});

 	//socket.on('reconnect', function() {
    //    disableLogin();
    // });

	//keep socket alive
//	function worker() {
	//	socket.emit('ping', 'ping');
	//	setTimeout(worker, 30000);
	//};
	
	//function disableLogin(){
	//    $('#gameServerOff').show();
	//    $('#loginForm').hide();
	//}
	
	
	//function login(){
	//	socket.emit('login', $('#userNameField').val(), $('#passwordField').val(),  function(login) {
	//				if (!login)
	//					alert("not log" )
	//		});
	//		return false;
	//};
	//worker();

</script>


<!--div id="gameServerOff" class="centered-resource hero-unit" style="margin-bottom:20px; display:none;" >
	<div class="span9">
		<h1> The game server is offline </h1>
	</div>
</div-->

<div class="centered-resource">
	<div class="span6">
		<div class="hero-unit">
			<h1>{{welcome}}!</h1>
			<p>
				{{welcome_message}}
			</p>
			<p>
				<a class="btn btn-primary btn-large">Learn more </a>
			</p>

		</div>
	</div><!--/span-->
	<div class="span4">
		<form id="loginForm" class="well" action="/userlogin/" name="userdata" method="post">
			{% csrf_token %}
			<div class="control-group{%if login_error%} error{%endif%}">
				<div class="username">
					<input id="userNameField" name="username" type="text" class="input" placeholder="{{username}}">
				</div>
				<div>
					<input id="passwordField" name="password" type="password" class="input-medium" placeholder="{{password}}">
					<button id="loginButon" onClick="" class="btn btn-success ui-button">
						Sign in
					</button>
				</div>
				{%if login_error%} <span class="help-inline">Wrong userame or password</span>{%endif%}
			</div>
		</form>
	</div><!--/span-->
</div>
<div class="centered-resource">

	
</div>



{% endblock %}
